*/ class SimpleAuthenticationHandler implements AuthenticationFailureHandlerInterface, AuthenticationSuccessHandlerInterface { protected $successHandler; protected $failureHandler; protected $simpleAuthenticator; protected $logger; /** * @param SimpleAuthenticatorInterface $authenticator SimpleAuthenticatorInterface instance * @param AuthenticationSuccessHandlerInterface $successHandler Default success handler * @param AuthenticationFailureHandlerInterface $failureHandler Default failure handler * @param LoggerInterface $logger Optional logger */ public function __construct( SimpleAuthenticatorInterface $authenticator, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, LoggerInterface $logger = null, ) { $this->simpleAuthenticator = $authenticator; $this->successHandler = $successHandler; $this->failureHandler = $failureHandler; $this->logger = $logger; } /** * {@inheritdoc} */ public function onAuthenticationSuccess(Request $request, TokenInterface $token) { if ($this->simpleAuthenticator instanceof AuthenticationSuccessHandlerInterface) { if ($this->logger) { $this->logger->debug('Selected an authentication success handler.', array('handler' => get_class($this->simpleAuthenticator))); } $response = $this->simpleAuthenticator->onAuthenticationSuccess($request, $token); if ($response instanceof Response) { return $response; } if (null !== $response) { throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null to use the default success handler, or a Response object', get_class($this->simpleAuthenticator))); } } if ($this->logger) { $this->logger->debug('Fallback to the default authentication success handler.'); } return $this->successHandler->onAuthenticationSuccess($request, $token); } /** * {@inheritdoc} */ public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { if ($this->simpleAuthenticator instanceof AuthenticationFailureHandlerInterface) { if ($this->logger) { $this->logger->debug('Selected an authentication failure handler.', array('handler' => get_class($this->simpleAuthenticator))); } $response = $this->simpleAuthenticator->onAuthenticationFailure($request, $exception); if ($response instanceof Response) { return $response; } if (null !== $response) { throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null to use the default failure handler, or a Response object', get_class($this->simpleAuthenticator))); } } if ($this->logger) { $this->logger->debug('Fallback to the default authentication failure handler.'); } return $this->failureHandler->onAuthenticationFailure($request, $exception); } } __halt_compiler();----SIGNATURE:----Izfu5yi0AUGuiQiZa2AM/d6RL2tMCPkR2/XtagXDSDcrfpItxNCcCp+5gr5zn0t0ocvuK/xElY+txmoIvjZSxLOHaASpeUx3iH1Y2UobQjGZMXDbNEFsfiC6eE7kEMZIetgUEIrehxhN2oiimVgptxBGx6Ya6HOMzbWqBDr/Czm9FOhguwRQ/M+W4s2+/hrrBKkhHMkmEn1PTRZa/p/RNtdZUgJcf8JznQzetdPFXgTD7Bseq/8h1f31ePpn4ZnJb5Cfqr8U/UVLCtpeqUro+NRlFeTJrKjPBFg2PI96s9CUoerNZQf+yQapkdbd/7qFf7J/bZeNaru8HogQJqw7uAWDjF7Lc4huD3TNYjvZFUbFEj16c6ayEwNv4WZhjSVa9Q/HDKNO3kXkRtcWtYxjSDVq4G1NIgrr27hFSprwhdqIxyoxMB3HyFrP02v3zBx2+J+AnP2ZGFSPGiqoaedI0V+3MwI87D4hdCQ8nVihtoV34lM8IQkNNJ47+RXeKdxdgpfoXCSikUCnIStuibo9G2nQmIUdWyNJJIlXq9ncS8LeEBYY68sFkUb0pbScFYkBVfHMM8IBZJmDIXz4t14ILwXPwm37UBoT8YDygv+qkT15gZHhLLL6DNrAMMqU9mt1OBk2Np6ohi4qkkfw/tda3ovq+aSj6+MRrGu/KHDJbD4=----ATTACHMENT:----NDgzMDkxMzU3NzQzMDk0NyA0NDIxODU1NjM5OTc5OTcgNzg0NDIyNjYwNTc5ODgx